import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:raze/artifacts/fortune_flora_dialog.dart';
import 'package:raze/artifacts/notifier_glimmer.dart';
import 'package:raze/artifacts/user_nav_bar_widget.dart';
import 'package:raze/lore/chronicle/qna_chronicle.dart';
import 'package:raze/lore/chronicle/user_chronicle.dart';
import 'package:raze/potions/raze_constant.dart';
import 'package:raze/potions/spatial_alchemy.dart';
import 'package:animated_flip_counter/animated_flip_counter.dart';
import 'dart:math';
import 'package:raze/artifacts/report_vault_dialog.dart';
import 'package:raze/artifacts/auth_portal_dialog.dart';
import 'package:raze/artifacts/clickable_avatar_widget.dart';
import 'package:raze/artifacts/question_inquiry_dialog.dart';

/// 首页
class HomeRealms extends StatefulWidget {
  const HomeRealms({super.key});

  @override
  State<HomeRealms> createState() => _HomeRealmsState();
}

class _HomeRealmsState extends State<HomeRealms> {
  final RxInt peopleSolved = 422.obs;
  final FocusNode _searchFocusNode = FocusNode();
  final TextEditingController _searchController = TextEditingController();
  final RxBool _showSearchSuggestions = false.obs;

  // 推荐搜索列表
  final List<String> _recommendedSearches = [
    'Why do leaves look greener after rain?',
    'Do plants really grow faster after rain?',
    'Why do some leaves hold water droplets better?',
  ];

  @override
  void initState() {
    super.initState();
    _startAutoIncrement();
    _searchFocusNode.addListener(_onFocusChange);
  }

  @override
  void dispose() {
    _searchFocusNode.removeListener(_onFocusChange);
    _searchFocusNode.dispose();
    _searchController.dispose();
    super.dispose();
  }

  void _onFocusChange() {
    _showSearchSuggestions.value = _searchFocusNode.hasFocus;
  }

  void _startAutoIncrement() {
    Future.delayed(Duration(milliseconds: 2000 + (Random().nextInt(3000))), () {
      peopleSolved.value++;
      _startAutoIncrement();
    });
  }

  /// 发起问题发布流程
  void _initiateQuestionPublish() {
    final userChronicle = Get.find<UserChronicle>();

    // 检查用户是否登录
    if (!userChronicle.isLoggedIn) {
      // 未登录，显示登录提示弹窗
      AuthPortalDialog.revealAuthPortal();
      return;
    }

    // 已登录，显示问题发布弹窗
    QuestionInquiryDialog.manifestQuestionInquiry(
      onQuestionPublished: (content) {
        final qnaChronicle = Get.find<QnAChronicle>();
        final currentUser = userChronicle.currentUser!;

        // 发布问题
        qnaChronicle.publishQuestion(currentUser.id, content);

        // 显示成功提示
        NotifierGlimmer.revealInfo('Question published successfully!');
      },
    );
  }

  @override
  Widget build(BuildContext context) {
    final qnaChronicle = Get.find<QnAChronicle>();
    final userChronicle = Get.find<UserChronicle>();

    return GestureDetector(
      onTap: () {
        // 点击空白区域时取消输入框焦点
        if (_searchFocusNode.hasFocus) {
          _searchFocusNode.unfocus();
        }
      },
      child: Scaffold(
        body: Container(
          decoration: const BoxDecoration(
            image: DecorationImage(
              image: AssetImage('assets/images/background.png'),
              fit: BoxFit.cover,
            ),
          ),
          child: SafeArea(
            bottom: false,
            child: Stack(
              children: [
                // 主要内容
                Column(
                  children: [
                    // 顶部导航栏
                    const UserNavBarWidget(),
                    16.h.boxHeight,

                    // 搜索框和Ask按钮
                    Padding(
                      padding: EdgeInsets.symmetric(horizontal: 16.w),
                      child: Row(
                        children: [
                          Expanded(
                            child: Container(
                              padding: EdgeInsets.symmetric(horizontal: 15.w),
                              height: 55.h,
                              decoration: BoxDecoration(
                                color: RazeConstants.white,
                                borderRadius: BorderRadius.circular(20.r),
                                border: Border.all(
                                  color: RazeConstants.black,
                                  width: 1.5.w,
                                ),
                              ),
                              child: Row(
                                children: [
                                  Image.asset(
                                    'assets/images/search.png',
                                    width: 20.w,
                                    height: 20.w,
                                  ),
                                  8.w.boxWidth,
                                  Expanded(
                                    child: TextField(
                                      controller: _searchController,
                                      focusNode: _searchFocusNode,
                                      decoration: InputDecoration(
                                        hintText:
                                            'Search For Questions, Updates',
                                        hintStyle: TextStyle(
                                          color: RazeConstants.black
                                              .withOpacity(0.4),
                                          fontSize: 12.sp,
                                          fontWeight: FontWeight.w400,
                                        ),
                                        border: InputBorder.none,
                                        isDense: true,
                                        contentPadding: EdgeInsets.zero,
                                      ),
                                      style: TextStyle(
                                        color: RazeConstants.black,
                                        fontSize: 12.sp,
                                        fontWeight: FontWeight.w400,
                                      ),
                                    ),
                                  ),
                                ],
                              ),
                            ).withRightBottomShadow(thickness: 1.5),
                          ),
                          6.w.boxWidth,
                          Container(
                                height: 55.h,
                                padding: EdgeInsets.symmetric(horizontal: 14.w),
                                decoration: BoxDecoration(
                                  color: RazeConstants.yellow,
                                  borderRadius: BorderRadius.circular(20.r),
                                  border: Border.all(
                                    color: RazeConstants.black,
                                    width: 2.w,
                                  ),
                                ),
                                child: Center(
                                  child: Text('? Ask')
                                      .applyTypeSize(20.sp)
                                      .applyTypeColor(RazeConstants.white)
                                      .applyBagelFatOne(
                                        weight: FontWeight.w400,
                                        shadows: [
                                          Shadow(
                                            offset: Offset(-1.w, -1.w),
                                            blurRadius: 0,
                                            color: RazeConstants.black,
                                          ),
                                          Shadow(
                                            offset: Offset(1.w, -1.w),
                                            blurRadius: 0,
                                            color: RazeConstants.black,
                                          ),
                                          Shadow(
                                            offset: Offset(-1.w, 1.w),
                                            blurRadius: 0,
                                            color: RazeConstants.black,
                                          ),
                                          Shadow(
                                            offset: Offset(1.w, 1.w),
                                            blurRadius: 0,
                                            color: RazeConstants.black,
                                          ),
                                          Shadow(
                                            offset: Offset(0, -1.w),
                                            blurRadius: 0,
                                            color: RazeConstants.black,
                                          ),
                                          Shadow(
                                            offset: Offset(0, 1.w),
                                            blurRadius: 0,
                                            color: RazeConstants.black,
                                          ),
                                          Shadow(
                                            offset: Offset(-1.w, 0),
                                            blurRadius: 0,
                                            color: RazeConstants.black,
                                          ),
                                          Shadow(
                                            offset: Offset(1.w, 0),
                                            blurRadius: 0,
                                            color: RazeConstants.black,
                                          ),
                                        ],
                                      ),
                                ),
                              )
                              .withRightBottomShadow(thickness: 1.5)
                              .withTouchResonance(
                                onTap: () {
                                  // 导航到搜索页面，传递搜索文本
                                  final searchText = _searchController.text;
                                  Get.toNamed(
                                    '/query',
                                    parameters: {'query': searchText},
                                  );
                                },
                              ),
                        ],
                      ),
                    ),
                    20.h.boxHeight,

                    // 可滑动的内容区域
                    Expanded(
                      child: SingleChildScrollView(
                        padding: EdgeInsets.symmetric(horizontal: 16.w),
                        child: Column(
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: [
                            // 海报图片
                            LayoutBuilder(
                              builder: (context, constraints) {
                                final posterWidth = constraints.maxWidth;
                                final posterAspectRatio = 343 / 203;
                                final posterHeight =
                                    posterWidth / posterAspectRatio;

                                return SizedBox(
                                  width: posterWidth,
                                  height: posterHeight,
                                  child: Image.asset(
                                    'assets/images/home-poster.png',
                                    fit: BoxFit.cover,
                                  ),
                                );
                              },
                            ),
                            20.h.boxHeight,

                            // 两个图片按钮的Row（相同高度，保持各自宽高比）
                            LayoutBuilder(
                              builder: (context, constraints) {
                                final availableWidth = constraints.maxWidth;
                                final spacing = 12.w; // 间距

                                // 两个图片的宽高比
                                final knowledgeAspectRatio = 134 / 124;
                                final luckyPlantAspectRatio = 196 / 124;

                                // 使用宽高比的分子作为flex值，保持正确的比例关系
                                // knowledge: 134/124, lucky-plant: 196/124
                                final knowledgeFlex = 134;
                                final luckyPlantFlex = 196;

                                // 计算在可用宽度下各自的宽度（减去间距）
                                final contentWidth = availableWidth - spacing;
                                final totalFlex =
                                    knowledgeFlex + luckyPlantFlex;
                                final knowledgeWidth =
                                    contentWidth * knowledgeFlex / totalFlex;
                                final luckyPlantWidth =
                                    contentWidth * luckyPlantFlex / totalFlex;

                                // 计算相同高度（基于各自宽度和宽高比，取较小值确保不溢出）
                                final knowledgeHeight =
                                    knowledgeWidth / knowledgeAspectRatio;
                                final luckyPlantHeight =
                                    luckyPlantWidth / luckyPlantAspectRatio;
                                final commonHeight =
                                    knowledgeHeight < luckyPlantHeight
                                        ? knowledgeHeight
                                        : luckyPlantHeight;

                                return Row(
                                  children: [
                                    Expanded(
                                      flex: knowledgeFlex,
                                      child: SizedBox(
                                        height: commonHeight,
                                        child: Image.asset(
                                          'assets/images/knowledge-button.png',
                                          fit: BoxFit.contain,
                                        ),
                                      ).withTouchResonance(
                                        onTap: () {
                                          // 导航到环保教育页面
                                          Get.toNamed('/environment');
                                        },
                                      ),
                                    ),
                                    SizedBox(width: spacing),
                                    Expanded(
                                      flex: luckyPlantFlex,
                                      child: SizedBox(
                                        height: commonHeight,
                                        child: Image.asset(
                                          'assets/images/lucky-plant-button.png',
                                          fit: BoxFit.contain,
                                        ),
                                      ).withTouchResonance(
                                        onTap: () {
                                          // 显示幸运植物引导弹窗
                                          FortuneFloraDialog.manifestGuidance();
                                        },
                                      ),
                                    ),
                                  ],
                                );
                              },
                            ),
                            20.h.boxHeight,

                            // 解决人数
                            Obx(() {
                              final questions = qnaChronicle.questionList;
                              final firstQuestion =
                                  questions.isNotEmpty ? questions.first : null;
                              final firstQuestionUser =
                                  firstQuestion != null
                                      ? userChronicle.userList.firstWhereOrNull(
                                        (u) => u.id == firstQuestion.userId,
                                      )
                                      : null;
                              final displayQuestion =
                                  firstQuestion?.content ?? '';
                              final truncatedQuestion =
                                  displayQuestion.length > 20
                                      ? '${displayQuestion.substring(0, 20)}...'
                                      : displayQuestion;

                              return Container(
                                padding: EdgeInsets.symmetric(
                                  horizontal: 14.w,
                                  vertical: 6.h,
                                ),
                                decoration: BoxDecoration(
                                  color: RazeConstants.white,
                                  borderRadius: BorderRadius.circular(12.r),
                                  border: Border.all(
                                    color: RazeConstants.black.withOpacity(0.2),
                                    width: 1.5.w,
                                  ),
                                ),
                                child: Row(
                                  children: [
                                    // 左边：Waiting online按钮
                                    Container(
                                      padding: EdgeInsets.symmetric(
                                        horizontal: 11.w,
                                        vertical: 6.h,
                                      ),
                                      decoration: BoxDecoration(
                                        color: RazeConstants.black,
                                        borderRadius: BorderRadius.circular(
                                          14.r,
                                        ),
                                      ),
                                      child:
                                          Text('Waiting online')
                                              .applyTypeSize(14.sp)
                                              .applyTypeColor(
                                                RazeConstants.white,
                                              )
                                              .applyNotoSans(),
                                    ),
                                    6.w.boxWidth,
                                    // 中间：用户头像和问题文本
                                    if (firstQuestionUser != null) ...[
                                      ClickableAvatarWidget(
                                        userId: firstQuestionUser.id,
                                        avatarPath: firstQuestionUser.avatar,
                                        width: 22.w,
                                        height: 22.w,
                                      ),
                                      2.w.boxWidth,
                                    ],
                                    Expanded(
                                      child:
                                          Text(
                                                truncatedQuestion,
                                                maxLines: 1,
                                                overflow: TextOverflow.ellipsis,
                                              )
                                              .applyTypeSize(14.sp)
                                              .applyTypeColor(
                                                RazeConstants.black,
                                              )
                                              .applyNotoSans(),
                                    ),
                                    // 分隔线
                                    Container(
                                      height: 32.h,
                                      width: 1.5.w,
                                      color: RazeConstants.black,
                                    ).enshroudHorizontal(12.w),
                                    // 右边：翻牌器数字和Problem solved
                                    Column(
                                      crossAxisAlignment:
                                          CrossAxisAlignment.end,
                                      children: [
                                        Obx(
                                          () => AnimatedFlipCounter(
                                            duration: const Duration(
                                              milliseconds: 900,
                                            ),
                                            value: peopleSolved.value,
                                            wholeDigits: 0,
                                            textStyle: TextStyle(
                                              fontSize: 20.sp,
                                              color: RazeConstants.black,
                                              fontFamily:
                                                  GoogleFonts.bagelFatOne(
                                                    fontWeight: FontWeight.w400,
                                                  ).fontFamily,
                                            ),
                                          ),
                                        ),
                                        Text('Problem solved')
                                            .applyTypeSize(11.sp)
                                            .applyTypeColor(RazeConstants.black)
                                            .applyNotoSans(
                                              weight: FontWeight.w600,
                                            ),
                                      ],
                                    ),
                                  ],
                                ),
                              );
                            }),

                            12.h.boxHeight,

                            // Q&A 标题和上传按钮
                            Row(
                              mainAxisAlignment: MainAxisAlignment.spaceBetween,
                              children: [
                                Text('Q&A')
                                    .applyTypeSize(20.sp)
                                    .applyTypeColor(RazeConstants.black)
                                    .applyBagelFatOne(weight: FontWeight.w400),
                                Container(
                                      width: 32.w,
                                      height: 32.w,
                                      padding: EdgeInsets.all(8.w),
                                      decoration: BoxDecoration(
                                        color: RazeConstants.yellow,
                                        shape: BoxShape.circle,
                                        border: Border.all(
                                          color: RazeConstants.black,
                                          width: 1.w,
                                        ),
                                      ),
                                      child: Image.asset(
                                        'assets/images/upload-question.png',
                                        width: 20.w,
                                        height: 20.w,
                                      ),
                                    )
                                    .withRightBottomShadow(thickness: 1)
                                    .withTouchResonance(
                                      onTap: () => _initiateQuestionPublish(),
                                    ),
                              ],
                            ),
                            16.h.boxHeight,

                            // 问题列表
                            Obx(() {
                              final questions = qnaChronicle.questionList;

                              return Column(
                                children:
                                    questions.map((question) {
                                      final user = userChronicle.userList
                                          .firstWhereOrNull(
                                            (u) => u.id == question.userId,
                                          );
                                      final answerCount =
                                          qnaChronicle
                                              .fetchAnswersByQuestionId(
                                                question.id,
                                              )
                                              .length;

                                      return _buildQuestionCard(
                                        question: question,
                                        user: user,
                                        answerCount: answerCount,
                                        qnaChronicle: qnaChronicle,
                                      );
                                    }).toList(),
                              );
                            }),
                            120.h.boxHeight,
                          ],
                        ),
                      ),
                    ),
                  ],
                ),
                // 推荐搜索弹出框 - 放在最上层
                Obx(() {
                  if (!_showSearchSuggestions.value) {
                    return const SizedBox.shrink();
                  }
                  return Positioned(
                    top: 125.h, // 导航栏高度 + 间距 + 搜索框高度 + 间距
                    left: 16.w,
                    right: 106.w, // 给Ask按钮留空间
                    child: Container(
                      padding: EdgeInsets.symmetric(
                        horizontal: 16.w,
                        vertical: 12.h,
                      ),
                      decoration: BoxDecoration(
                        color: RazeConstants.white,
                        borderRadius: BorderRadius.circular(16.r),
                        border: Border.all(
                          color: RazeConstants.black,
                          width: 1.5.w,
                        ),
                      ),
                      child: Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        mainAxisSize: MainAxisSize.min,
                        children: [
                          Text('Recommended Searches')
                              .applyTypeSize(14.sp)
                              .applyTypeColor(RazeConstants.black)
                              .applyBagelFatOne(weight: FontWeight.w400),
                          8.h.boxHeight,
                          ..._recommendedSearches.map((search) {
                            return GestureDetector(
                              onTap: () {
                                // 点击推荐搜索项，填入搜索框
                                _searchController.text = search;
                                _searchFocusNode.unfocus();
                                // TODO: 执行搜索
                              },
                              child: Container(
                                margin: EdgeInsets.only(bottom: 8.h),
                                padding: EdgeInsets.symmetric(
                                  horizontal: 12.w,
                                  vertical: 10.h,
                                ),
                                decoration: BoxDecoration(
                                  color: RazeConstants.background,
                                  borderRadius: BorderRadius.circular(10.r),
                                  border: Border.all(
                                    color: RazeConstants.black.withOpacity(0.1),
                                    width: 1.w,
                                  ),
                                ),
                                child: Row(
                                  children: [
                                    Image.asset(
                                      'assets/images/search.png',
                                      width: 16.w,
                                      height: 16.w,
                                      color: RazeConstants.black.withOpacity(
                                        0.5,
                                      ),
                                    ),
                                    8.w.boxWidth,
                                    Expanded(
                                      child:
                                          Text(search)
                                              .applyTypeSize(13.sp)
                                              .applyTypeColor(
                                                RazeConstants.black,
                                              )
                                              .applyNotoSans(),
                                    ),
                                  ],
                                ),
                              ),
                            );
                          }),
                        ],
                      ),
                    ).withRightBottomShadow(thickness: 1.5),
                  );
                }),
              ],
            ),
          ),
        ),
      ),
    );
  }

  /// 构建问题卡片
  Widget _buildQuestionCard({
    required dynamic question,
    required dynamic user,
    required int answerCount,
    required QnAChronicle qnaChronicle,
  }) {
    // 每次都通过id拿最新question
    final questionId = question.id;
    final userChronicle = Get.find<UserChronicle>();
    return Obx(() {
      final questions = qnaChronicle.questionList;
      final currentUser = userChronicle.currentUser;
      final isLoggedIn = userChronicle.isLoggedIn;
      final current =
          questions.firstWhereOrNull((q) => q.id == questionId) ?? question;
      final liked =
          isLoggedIn && currentUser != null
              ? qnaChronicle.checkQuestionLiked(currentUser.id, questionId)
              : false;
      final likeColor = liked ? RazeConstants.red : RazeConstants.white;
      return Container(
        margin: EdgeInsets.only(bottom: 16.h),
        child: AspectRatio(
          aspectRatio: 343 / 153,
          child: Stack(
            children: [
              // 黄色底块及操作栏
              Container(
                decoration: BoxDecoration(
                  color: RazeConstants.yellow,
                  borderRadius: BorderRadius.circular(12.r),
                  border: Border.all(color: RazeConstants.black, width: 1.w),
                ),
                child: Column(
                  children: [
                    const Spacer(),
                    Padding(
                      padding: EdgeInsets.symmetric(
                        horizontal: 12.w,
                        vertical: 9.h,
                      ),
                      child: Row(
                        children: [
                          // 点赞按钮及数量
                          Row(
                            children: [
                              Image.asset(
                                'assets/images/like.png',
                                width: 20.w,
                                height: 20.w,
                                color: likeColor,
                              ),
                              6.w.boxWidth,
                              AnimatedFlipCounter(
                                duration: const Duration(milliseconds: 600),
                                value: current.likeCount,
                                textStyle: TextStyle(
                                  fontSize: 15.sp,
                                  color: RazeConstants.black,
                                  fontWeight: FontWeight.w600,
                                  fontFamily:
                                      GoogleFonts.notoSansSc(
                                        fontWeight: FontWeight.w600,
                                      ).fontFamily,
                                ),
                              ),
                            ],
                          ).withTouchResonance(
                            onTap: () {
                              if (!isLoggedIn) {
                                AuthPortalDialog.revealAuthPortal();
                                return;
                              }
                              if (currentUser != null) {
                                if (liked) {
                                  qnaChronicle.unlikeQuestion(
                                    currentUser.id,
                                    questionId,
                                  );
                                } else {
                                  qnaChronicle.likeQuestion(
                                    currentUser.id,
                                    questionId,
                                  );
                                }
                              }
                            },
                          ),
                          18.w.boxWidth,
                          // 回答icon及数量
                          Row(
                            children: [
                              Image.asset(
                                'assets/images/message-text.png',
                                width: 20.w,
                                height: 20.w,
                              ),
                              6.w.boxWidth,
                              Text('$answerCount')
                                  .applyTypeSize(15.sp)
                                  .applyTypeColor(RazeConstants.black)
                                  .applyNotoSans(),
                            ],
                          ),
                          const Spacer(),
                          // 回答按钮
                          GestureDetector(
                            onTap: () {
                              // 跳转到问答详情页
                              Get.toNamed(
                                '/knowledge-discourse',
                                parameters: {'questionId': questionId},
                              );
                            },
                            child: Container(
                              padding: EdgeInsets.symmetric(
                                horizontal: 11.w,
                                vertical: 4.h,
                              ),
                              decoration: BoxDecoration(
                                color: RazeConstants.black,
                                borderRadius: BorderRadius.circular(8.r),
                              ),
                              child: Center(
                                child: Text('Answer')
                                    .applyTypeSize(16.sp)
                                    .applyTypeColor(RazeConstants.white)
                                    .applyNotoSans(weight: FontWeight.w600),
                              ),
                            ),
                          ),
                        ],
                      ),
                    ),
                  ],
                ),
              ),
              // 浮层内容块（白色）
              Positioned(
                top: 0,
                left: 0,
                right: 0,
                child: GestureDetector(
                  onTap: () {
                    // 点击问题内容区域也跳转到详情页
                    Get.toNamed(
                      '/knowledge-discourse',
                      parameters: {'questionId': questionId},
                    );
                  },
                  child: AspectRatio(
                    aspectRatio: 343 / 104,
                    child: Container(
                      decoration: BoxDecoration(
                        color: RazeConstants.background,
                        borderRadius: BorderRadius.circular(12.r),
                        border: Border.all(
                          color: RazeConstants.black,
                          width: 1.w,
                        ),
                      ),
                      child: Padding(
                        padding: EdgeInsets.symmetric(
                          horizontal: 14.w,
                          vertical: 12.h,
                        ),
                        child: Column(
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: [
                            Row(
                              crossAxisAlignment: CrossAxisAlignment.center,
                              children: [
                                // 用户头像
                                if (user != null)
                                  ClickableAvatarWidget(
                                    userId: user.id,
                                    avatarPath: user.avatar,
                                    width: 26.w,
                                    height: 26.w,
                                  ),
                                if (user != null) 8.w.boxWidth,
                                // 用户名
                                Expanded(
                                  child: Text(user?.username ?? '')
                                      .applyTypeSize(18.sp)
                                      .applyTypeColor(RazeConstants.black)
                                      .applyBagelFatOne(
                                        weight: FontWeight.w400,
                                      ),
                                ),
                                // 举报按钮
                                GestureDetector(
                                  onTap: () {
                                    ReportVaultDialog.revealReportVault(
                                      onReportSubmitted: (_) {
                                        // 提示
                                        NotifierGlimmer.revealInfo(
                                          'Reported submitted successfully.',
                                        );
                                        // 删除被举报的问题
                                        qnaChronicle.deleteQuestionById(
                                          questionId,
                                        );
                                      },
                                    );
                                  },
                                  child: Image.asset(
                                    'assets/images/report.png',
                                    width: 20.w,
                                    height: 20.w,
                                  ),
                                ),
                              ],
                            ),
                            10.h.boxHeight,
                            // 问题内容 最多两行
                            Expanded(
                              child:
                                  Text(
                                        current.content,
                                        maxLines: 2,
                                        overflow: TextOverflow.ellipsis,
                                      )
                                      .applyTypeSize(14.sp)
                                      .applyTypeColor(RazeConstants.black)
                                      .applyNotoSans(),
                            ),
                          ],
                        ),
                      ),
                    ),
                  ),
                ),
              ),
            ],
          ),
        ),
      );
    });
  }
}
